package com.example.demo.service;

import com.example.demo.mapper.LogMapper;

import com.example.demo.model.LogInfo;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author 郝文雪
 * @date 2022/8/4 17:39
 * @Description Test
 */
@Service
public class LogService {
    @Resource
    private LogMapper logMapper;

    @Transactional(propagation = Propagation.NESTED)
    public int add(LogInfo logInfo){
        int num=10/0;
        return logMapper.add(logInfo);
    }
}
